/*!
\file DNodeData.cpp
\brief Contains implementation of DNodeData
\ingroup DOT
*/

#include"DNodeData.h"

DNodeData::DNodeData( QString data ){
	if( !data.contains("[") ){
		_setID(data);
	}else{
		QStringList dataParts = data.split( "[" );
		_setID( dataParts[0] );
		dataParts = dataParts[1].split( "]" );
		_setOptions(dataParts[0]);
	}
}

DNodeData::~DNodeData(){

}

void DNodeData::_setID( QString id ){
	id = id.remove(";");
	id = id.remove(" ");
	m_id = id.toInt();
}

QString DNodeData::toDOT()const{
	QString ret;
	
	ret.setNum(m_id);
	ret.append( _dotOptions() );
	ret.append(";");
	
	return ret;
}
